home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_08 / saks / inserter.cpp < prev    next >
Encoding:
Text File  |  1994-06-12  |  306 b   |  14 lines

  1. Listing 8 - a operator<< for strq using the new apply function(s) 
  2. instead of a global variable
  3.  
  4. void print_str(void *e, void *args)
  5.     {
  6.     *(ostream *)args << ' ' << *(str *)e;
  7.     }
  8.  
  9. inline ostream &operator<<(ostream &os, strq &q)
  10.     {
  11.     q.apply(print_str, &os);
  12.     return os;
  13.     }
  14.